<?php
header("WWW-Authenticate: Basic realm=\"localhost\"");
header("HTTP/1.0 401 Unauthorized");
echo "<h2>Authentication Failure</h2>"; 
setcookie("user", "", time()-3600);
?>

<html>
<body>

<meta http-equiv="REFRESH" content="0;url=http://localhost/demo.php">

</body>
</html>